package ar.com.vates.ejercicio2;


public class Borra implements Runnable {
	private Contenedor contenedor;
	
	public Borra(Contenedor con){
		this.contenedor=con;
	}

	
	@Override
	public void run() {
		 
			try {
				for(int i=0;i<10;i++){
				  if(contenedor.getNumero()==0)
					  Thread.sleep(2000);
				  
				  else{
					  contenedor.setNumero(0);
					  System.out.println("Borra"+ contenedor.getNumero());;
				  }
				  }
				
			} catch (InterruptedException e) {
				e.printStackTrace();
			}
		}

	}

	

